package org.apache.sad.core.framework.concurrent;

import java.util.concurrent.ThreadFactory;

public class DaemonThreadFactory implements ThreadFactory {
	private final static DaemonThreadFactory instance = new DaemonThreadFactory();
	
	private DaemonThreadFactory() {}
	
	public static DaemonThreadFactory getInstance() {
		return instance;
	}
	
	public Thread newThread(Runnable runnable) {
		Thread thread = new Thread(runnable);
		thread.setDaemon(true);
		return thread;
	}
}
